var express = require('express');
var router = express.Router();
var token = require('../util/tokenUtil.js');
var writeDao = require('../dao/writeDao.js');

/* GET home page. */
router.get('/', function(req, res, next) {
    res.render('index', { title: 'Express' });
});

router.use('/blog',token.verifyToken,function(req, res, next) {
    writeDao.write(req, res, next);
});

router.use('/tag',token.verifyToken,function(req, res, next) {
    writeDao.tag(req, res, next);
});

module.exports = router;
